{extend name="common/form" /}
{block name="form" /}
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
    <div class="widget am-cf">
        <div class="widget-head am-cf">
            <div class="widget-title am-fl">用户信息</div>
        </div>
        <div class="widget-body am-fr">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black " id="example-r">
                    <tbody>

                    <tr class="even gradeC">
                        <td>订单号</td>
                        <td style="color:red;">{$info.order_number}</td>
                    </tr>
                    <tr class="gradeX" style="color: red;">
                        <td>订单状态</td>
                        <td> {$info.status ==0?"待发货":""}{$info.status ==1?"已发货":""}{$info.status ==2?"已发货":""}</td>
                    </tr>
                    <tr class="even gradeC">
                        <td>商品图片</td>
                        <td> <img src="{$info.goods_images}" onclick="window.open('{$info.goods_images}')" style="width: 90px;height: 90px;"></td>
                    </tr>
                    <tr class="even gradeC">
                        <td>商品名</td>
                        <td> {$info.goods_title}</td>
                    </tr>
                    <tr class="even gradeC">
                        <td>兑换数量</td>
                        <td>{$info.number}</td>
                    </tr>
                    <tr class="even gradeC">
                        <td>所用积分</td>
                        <td>{$info.integral}</td>
                    </tr>

                    <tr class="even gradeC">
                        <td>下单人</td>
                        <td>{$info.true_name}</td>
                    </tr>

                    <tr class="even gradeC">
                        <td>下单人电话</td>
                        <td>{$info.phone}</td>
                    </tr>
                    <tr class="even gradeC">
                        <td>下单地址</td>
                        <td>{$info.address} {$info.address_name} {$info.floor_address}</td>
                    </tr>
                    <tr class="even gradeC">
                        <td>下单时间</td>
                        <td>{$info.create_time}</td>
                    </tr>
                    </tbody>
                </table>
                {eq name="$info.status" value="0"}

                <button  type="button" class="am-btn am-btn-primary" onclick="fahuo('{$info.id}')"> 发货</button>
                {/eq}


            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}

<script type="text/javascript">
    function fahuo(id) {
        var index =  layer.confirm('确定要发货？',function () {
            $.post('{:url("fahuo")}',{id:id},function (result) {
                if(result.code!=0){
                    layer.alert(result.msg,{icon:5})
                }else{
                    layer.alert('发货成佃!',{icon:6},function () {
                        var index = parent.layer.getFrameIndex(window.name);
                        window.parent.location.reload();
                        parent.layer.close(index);//关闭当前页

                    })
                }
            })
//                    layer.close(index)
        })
    }
</script>
{/block}
{/extend}